#ifndef CFONT_H
#define CFONT_H

extern "C"{
    //font.h对应的静态库 libfont.a是用C编译器生成的，所以头文件前面加上 extern C  进行 声明
    #include "font.h"
}

#include <unistd.h>


class CFont
{
    CFont();

public:
    enum Color{
        RED = 0x00ff0000,
        GREEN = 0x0000ff00,
        BLUE = 0x000000ff,
        BLACK = 0x00000000,
        WHITE = 0x00ffffff
    };

    ~CFont();

    void initLcd(const char *device = "/dev/fb0");
    void destoryLcd();

    void show(char*text,int pixelsize,int backgroundWidth,int backgroundHeight,int backgroundColor = WHITE,int fontColor = BLACK ,int posXToLcd=0,int posYToLcd=0);
    void show(const char*text,int pixelsize,int backgroundWidth,int backgroundHeight,int backgroundColor = WHITE,int fontColor = BLACK ,int posXToLcd=0,int posYToLcd=0);

    //  提供全局 访问点
    static CFont* instance();
private:
    struct LcdDevice *m_lcd;

    static CFont *m_instance;
};

#endif // CFONT_H
